package com.gxuwz.com_property.user.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.gxuwz.com_property.user.dto.UserDto;
import com.gxuwz.com_property.user.pojo.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.springframework.web.bind.annotation.Mapping;

import javax.transaction.Transactional;

@Mapper

public interface UserMapper extends BaseMapper<User> {
    /**
     * 添加
     * */
    public Boolean addUserInfo(User user);
    /**
     * 修改
     * */
    public Boolean updateUserInfo(User user);

    /**
     * 删除
     * */
    @Transactional   //开启事务，在提交时，将事务进行提交
    public Boolean delectUserById(String account);

    /**
     * 根据Id进行查询
     * */
    public User selectUsersById(String account);

    /**
     * 分页查询
     */
    public IPage<User> selectUsersByPage(Page<User> page, @Param("userDto") UserDto userDto);

}
